﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PJ.Data.Partner;

namespace PJ.Business.Partner
{
    public abstract class Partner<T> : Item<T>, IPartner
        where T : IPartnerData
    {
        public Partner(T data)
            : base(data)
        {
        }
        public Partner()
        {
        }

        public string Phone
        {
            get
            {
                return ObjectData.Phone;
            }
            set
            {
                if (ObjectData.Phone != value)
                {
                    ObjectData.Phone = value;
                }
            }
        }
        public string Address
        {
            get
            {
                return ObjectData.Address;
            }
            set
            {
                if (ObjectData.Address != value)
                {
                    ObjectData.Address = value;
                }
            }
        }

        public override void CopyFrom(IBusinessObject data)
        {
            base.CopyFrom(data);
            IPartner idata = data as IPartner;
            if (idata != null)
            {
                this.Phone = idata.Phone;
                this.Address = idata.Address;
            }
        }

    }
}
